﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using SanFranciscoModel.Alumno;

namespace SanFrancisco
{
    public partial class ListarNotaAlumno : Form
    {
        private int _DNI;
        public ListarNotaAlumno(int dni)
        {
            _DNI = dni;
            InitializeComponent();
            

        }

        private void btnGuardar_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void ListarNotaAlumno_Load(object sender, EventArgs e)
        {
           
            
            AlumnoDataContext a = new AlumnoDataContext();
            gridNotasAlumno.AutoGenerateColumns = false;
            gridNotasAlumno.DataSource = a.AlumnosListarNotas(_DNI);
                if (gridNotasAlumno.Rows.Count == 0)
                  {
                    MessageBox.Show("El alumno no posee ninguna nota asignada");
                    this.Close();
                }

            
        }

    }
}
